package com.itheima.demo.demo03.demo04;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class PersonHashMap {
    public static void main(String[] args) {
        HashMap<Person,String>map=new HashMap<>();
        map.put(new Person("诸葛亮",45),"美国");
        map.put(new Person("诸葛亮",45),"蜀国");
        map.put(new Person("曹超",45),"魏国");
        map.put(new Person("孙尚香",45),"吴国");
        Set<Map.Entry<Person, String>> entries = map.entrySet();
        for (Map.Entry<Person, String> entry : entries) {
            Person key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+" "+value);



        }


    }
}
